package com.huilian.iotbox.data.service.impl;

import com.huilian.iotbox.data.dao.CommoditySupplierContactCommonDao;
import com.huilian.iotbox.data.dto.CommoditySupplierContactDto;
import com.huilian.iotbox.data.service.CommoditySupplierContactCommonService;
import com.huilian.iotbox.data.vo.CommoditySupplierContactVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CommoditySupplierContactCommonServiceImpl implements CommoditySupplierContactCommonService {
    @Autowired
    private CommoditySupplierContactCommonDao commoditySupplierContactDao;

    @Override
    public int addSuppliersContact(CommoditySupplierContactDto commoditySupplierContactDto) throws Exception {
        return commoditySupplierContactDao.add(commoditySupplierContactDto);
    }

    @Override
    public int update(CommoditySupplierContactDto commoditySupplierContactDto) throws Exception {
        return commoditySupplierContactDao.update(commoditySupplierContactDto);
    }

    @Override
    public int delSuppliersContact(Integer id) {
        return commoditySupplierContactDao.delById(id);
    }

    @Override
    public List<CommoditySupplierContactVo> findBySupplierId(Integer supplierId) {
        return commoditySupplierContactDao.findBySupplierId(supplierId);
    }
}
